<?php

namespace app\modules\index\controllers;

use app\common\controllers\CorsController;
use app\modules\index\services\AdvertService;
use app\modules\index\services\MerchantCategoryService;

class MerchantCategoryController extends CorsController{

    //搜索
    public function actionSearch(){
        $parent_id = \Yii::$app->getRequest()->get("parent_id");
        return [
            'categorys'=>MerchantCategoryService::getTree($parent_id),
            'adverts'=>AdvertService::search(2)
        ];
    }
}